$input = <<END;
# Time: %time%
# Test %i%

Test <- ga.solve(%dims%,%population%,D[,%numer%],evaluator=cec2005benchmark%numer%, mutationProb=%mP%) 
print("%i%")
print("Wynik: ") 
print(Test[[3]])
print(" Spodziewany: ")
print(F[%numer%])
print(" Z iteracji: ")
print(Test[4])
print(" ")
print(" ")
print(" ")
save(Test, file = 'c:\\\\testy\\\\run%time%-test%numer%-dims%dims%-popSize%population%-mut%mP%.data', ascii=TRUE)



END

$time = time();
@mPs = (0.1, 0.2, 0.5);
@pops = (10,50,100);
@tests = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25);
@dims = (2,10,50);

$i = 1;

open(FH, ">script-$time.r");

foreach my $dim (@dims) {
	foreach my $test (@tests) {
		foreach my $pop (@pops) {
			foreach my $mP (@mPs) {
				$new = $input;
				$new =~ s/%dims%/$dim/g;
				$new =~ s/%time%/$time/g;
				$new =~ s/%i%/$i/g;
				$new =~ s/%numer%/$test/g;
				$new =~ s/%population%/$pop/g;
				$new =~ s/%mP%/$mP/g;
				
				print FH $new;
				
				
				$i++;
			}
		}
	}
}

close(FH);